# -*- coding: utf-8 -*-
'''
@文件    :base.py
@说明    :
@时间    :2025/08/28 15:30:00
@作者    :浪晋
@版本    :1.0
'''

from typing import Optional
from tortoise.expressions import Q
from app.cruds.base import CRUDBase
from app.models.user import UserBaseModel
from app.schemas.user.base import CreateSchema, UpdateSchema


class Crud(CRUDBase[UserBaseModel, CreateSchema, UpdateSchema]):
    def __init__(self):
        super().__init__(model=UserBaseModel)

    async def get_by_id(self, id: int) -> Optional[UserBaseModel]:
            return await self.model.filter(id=id).first()

crud = Crud()